﻿using Basic.OACollect;
using Basic.OAModel.DB;
using Basic.OARemoteModel.FillInItem.Model;
using Basic.OAService.Interface;
using WeDonekRpc.Client;
using WeDonekRpc.Model;

namespace Basic.OAService.lmpl
{
    internal class FillInItemService : IFillInItemService
    {
        private readonly IEmpFillInItemCollect _FillInItem;

        public FillInItemService ( IEmpFillInItemCollect fillInItem )
        {
            this._FillInItem = fillInItem;
        }
        public void Delete ( long fillId, long empId )
        {
            DBEmpFillInItem item = this._FillInItem.Get(fillId, empId);
            this._FillInItem.Delete(item);
        }

        public PagingResult<long> Query ( FillInItemQuery query, IBasicPage paging )
        {
            long[] ids = this._FillInItem.Query(query, paging, out int count);
            return new PagingResult<long>(ids, count);
        }

        public void Sync ( long fillId, FillInEmp[] emps )
        {
            this._FillInItem.Sync(fillId, emps);
        }
    }
}
